package com.wymobilearchitecture.home

import android.os.Bundle
import android.view.View
import android.widget.Toast
import com.wy.common.base.BaseFragment
import com.wy.w_ui.view.text.RichTextView
import com.wymobilearchitecture.R

class HomeFragment01 : BaseFragment(){

    override fun getLayoutId(): Int {
       return R.layout.home_fragment_01
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        val richTextView : RichTextView = view.findViewById(R.id.richTextView)

        val textBeans : MutableList<RichTextView.TextBean> = ArrayList()

        textBeans.add(RichTextView.TextBean(" aaa ","#387dcc", RichTextView.ITextClick {
            Toast.makeText(this@HomeFragment01.context,it.content,Toast.LENGTH_SHORT).show()
        }))

        textBeans.add(RichTextView.TextBean(" bbb ","#387dcc", RichTextView.ITextClick {
            Toast.makeText(this@HomeFragment01.context,it.content,Toast.LENGTH_SHORT).show()
        }))

        textBeans.add(RichTextView.TextBean(" ccc ","#387dcc", RichTextView.ITextClick {
            Toast.makeText(this@HomeFragment01.context,it.content,Toast.LENGTH_SHORT).show()
        }))

        richTextView.setText(textBeans)
    }
}